#-*- coding:utf-8 -*-
__author__ = 'root'

import datetime
from mongoengine import Document
from mongoengine.fields import StringField,DateTimeField,URLField,ObjectIdField


class finance(Document):
    title=StringField(required=True)
    content_href=URLField(default=u'')
    spider_jod_id=StringField(required=True)
    create_time=DateTimeField(required=True,default=datetime.datetime.now())


    meta = {"db_alias": "news"}


class finance_words(Document):
    '''
    finance 与 key_words 之间的多对多关系
    '''
    key_words_id=ObjectIdField(required=True)
    finance_id=ObjectIdField(required=True)

    meta = {"db_alias": "news"}



class key_words(Document):
    word=StringField(required=True)

    meta = {"db_alias": "news"}
